<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <title>更新数据</title>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript">
        var rssilist = [];
        var flag1 = false;
        var timeID;
        $(function () {
            $.ajax({
                type: "get",
                async: false,
                url: "getxy",
                data: {
                    status: "RSSIDATA"
                },
                dataType: "json",
                success: function (data) {
                    for (var i = 0; i < data.length; i++) {
                        rssilist.push({
                            x: data[i].x,
                            y: data[i].y,
                            ap1Mac: data[i].ap1Mac,
                            ap1Rssi: data[i].ap1Rssi,
                            ap2Mac: data[i].ap1Mac,
                            ap2Rssi: data[i].ap1Rssi,
                            ap3Mac: data[i].ap1Mac,
                            ap3Rssi: data[i].ap1Rssi
                        });
                    }
                },
                error: function () {
                    alert("获取数据失败");
                }
            });


            $("#mytable").empty();
            $("#mytable").append("<tr id='top'>"
                + "<th> 编号 </th>"
                + "<th> X </th>"
                + "<th> Y </th>"
                + "<th>AP1MAC</th>"
                + "<th>AP1RSSI</th>"
                + "<th>AP2MAC</th>"
                + "<th>AP2RSSI</th>"
                + "<th>AP3MAC</th>"
                + "<th>AP3RSSI</th>"
                + "</tr>");
            for (var i = 0; i < rssilist.length; i++) {
                $("#top").after("<tr>"
                    + "<th>" + (i + 1) + "</th>"
                    + "<th>" + rssilist[i].x + "</th>"
                    + "<th>" + rssilist[i].y + "</th>"
                    + "<th>" + rssilist[i].ap1Mac + "</th>"
                    + "<th>" + rssilist[i].ap1Rssi + "</th>"
                    + "<th>" + rssilist[i].ap2Mac + "</th>"
                    + "<th>" + rssilist[i].ap2Rssi + "</th>"
                    + "<th>" + rssilist[i].ap3Mac + "</th>"
                    + "<th>" + rssilist[i].ap3Rssi + "</th>"
                    + "</tr>");
            }


        });


    </script>
</head>
<body>
<div style="float: left;width: 10%">
    <a href="http://120.27.237.68:8080/web/data.html">数据库内容1</a><br>
    <a href="http://120.27.237.68:8080/web/location.html">定位界面1</a><br>
    <a href="http://120.27.237.68:8080/web/location2.html">定位界面2</a><br>
    <a href="http://120.27.237.68:8080/web/TD2.html">热力图1</a><br/>
    <a href="http://120.27.237.68:8080/web/TD.html">热力图2</a><br/>
</div>

<div style="float: right;width: 90%">
    <table id="mytable" align="center" width="800" border="1" cellpadding="0"></table>
</div>


<div style="float: left;width: 10%">

</div>

<div style="float: right;width: 90%">

</div>

</body>
</html>